﻿using System;
using System.Data;
using Besture.Bll;
using Besture.Common;
using Besture.Common.Helper;


namespace Besture.UI.Admin.Content
{
    public partial class GetContentModelField : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string modelID = StringHelper.Query("ModelID");

            DataTable table =
                QueryDac.GetTable(
                    string.Format(
                        @"SELECT tmf.*,td.Name as FieldTypeName FROM TBContentModelField tmf
                            LEFT JOIN TBDictionary td
                            ON tmf.FieldType = td.Value 
                            WHERE td.FlagType = 1 AND tmf.ModelID = {0}",
                        modelID));

            Response.Write(JsonHelper.ToJson(table));
            Response.End();
        }
    }
}